package com.mangosteen.interviewji.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mangosteen.interviewji.model.dto.questionAssociate.QuestionAssociateQueryRequest;
import com.mangosteen.interviewji.model.entity.QuestionAssociate;
import com.mangosteen.interviewji.model.vo.QuestionAssociateVO;

import javax.servlet.http.HttpServletRequest;

/**
 * 题目关联服务
 *
 * @author <a href="https://github.com/liyupi">程序员鱼皮</a>
 * @from <a href="https://www.code-nav.cn">编程导航学习圈</a>
 */
public interface QuestionAssociateService extends IService<QuestionAssociate> {

    /**
     * 校验数据
     *
     * @param questionAssociate
     * @param add 对创建的数据进行校验
     */
    void validQuestionAssociate(QuestionAssociate questionAssociate, boolean add);

    /**
     * 获取查询条件
     *
     * @param questionAssociateQueryRequest
     * @return
     */
    QueryWrapper<QuestionAssociate> getQueryWrapper(QuestionAssociateQueryRequest questionAssociateQueryRequest);
    
    /**
     * 获取题目关联封装
     *
     * @param questionAssociate
     * @param request
     * @return
     */
    QuestionAssociateVO getQuestionAssociateVO(QuestionAssociate questionAssociate, HttpServletRequest request);

    /**
     * 分页获取题目关联封装
     *
     * @param questionAssociatePage
     * @param request
     * @return
     */
    Page<QuestionAssociateVO> getQuestionAssociateVOPage(Page<QuestionAssociate> questionAssociatePage, HttpServletRequest request);
}
